package game.craft.model;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.image.ImageObserver;

/**
 * Created by IntelliJ IDEA.
 * User: ccayirog
 * Date: Mar 27, 2011
 * Time: 2:31:48 PM
 * To change this template use File | Settings | File Templates.
 */
public class Alien extends AbstractItem implements Item {


    public Alien(int x, int y) {
        super("D:\\Documents and Settings\\ccayirog\\Desktop\\my_game\\images\\alien.png", x, y);
    }


    public void move() {
        if (x < 0)
            x = 400;
        x -= 1;
    }

    public void keyPressed(KeyEvent e) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void keyReleased(KeyEvent e) {
        //To change body of implemented methods use File | Settings | File Templates.
    }

    public void draw(Graphics graphics, ImageObserver observer) {
        if (exist)
            graphics.drawImage(image, x, y, observer);
    }
}
